package com.lk.demo.b.controller;

import com.lk.demo.b.service.AServiceFeignClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wangzhanjin on 2018/4/12.
 */
@RestController
public class SayHelloController {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    AServiceFeignClient aServiceFeignClient;


    @Value("${tomas:aaa}")
    private String defaultName;

    @GetMapping("/hello/{name}")
    public String hello(@PathVariable String name){
        logger.info("詹姆斯邦德");
        return aServiceFeignClient.hello(null==name?defaultName:name);
    }
}